package cn.jetpiece.cloud.system.dp.api.biz;

import cn.jetpiece.cloud.model.page.PageResult;
import cn.jetpiece.cloud.model.response.Result;
import cn.jetpiece.cloud.system.dp.api.biz.model.params.CreateDpTAppParam;
import cn.jetpiece.cloud.system.dp.api.biz.model.params.UpdateDpTAppParam;
import cn.jetpiece.cloud.system.dp.api.biz.model.query.DpTAppQuery;
import cn.jetpiece.cloud.system.dp.api.biz.model.result.DpTAppResult;
import cn.jetpiece.cloud.resource.annotation.annotation.ApiResource;
import cn.jetpiece.cloud.resource.annotation.annotation.ScanResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * dp_t_app
 *
 * @author jetpiece
 * @since 2023-05-15
 */
@Api(tags="dp_t_app")
@ApiResource(name="dp_t_app")
public interface DpTAppApi {

    String API = "/datapipeline/biz/dpTApps";

    /**
     * 新增dp_t_app
     *
     * @param param 新增参数
     * @return 返回结果
     */
    @ApiOperation(value = "新增dp_t_app")
    @ScanResource(name = "新增dp_t_app", path = API, method = RequestMethod.POST)
    Result<String> add(@RequestBody @Valid CreateDpTAppParam param);

    /**
     * 修改dp_t_app
     *
     * @param param 修改参数
     * @return 返回结果
     */
    @ApiOperation(value = "修改dp_t_app")
    @ScanResource(name = "修改dp_t_app", path = API, method = RequestMethod.PUT)
    Result<String> update(@RequestBody @Valid UpdateDpTAppParam param);

    /**
     * 删除dp_t_app
     *
     * @param id 主键
     * @return 返回结果
     */
    @ApiOperation(value = "删除dp_t_app")
    @ScanResource(name = "删除dp_t_app", path = API + "/{id}", method = RequestMethod.DELETE)
    Result<String> delete(@PathVariable(name = "id") Long id);

    /**
     * 批量删除dp_t_app
     *
     * @param ids
     * @return 返回结果
     */
    @ApiOperation(value = "批量删除dp_t_app")
    @ScanResource(name = "批量删除dp_t_app", path = API+"/batch-del/{ids}", method = RequestMethod.DELETE)
    Result<String> deleteBatch(@PathVariable("ids") String ids);

    /**
     * 查询dp_t_app信息
     *
     * @param id 主键
     * @return 返回结果
     */
    @ApiOperation(value = "查询dp_t_app信息")
    @ScanResource(name = "查询dp_t_app信息", path = API + "/{id}", method = RequestMethod.GET)
    Result<DpTAppResult> get(@PathVariable(name = "id") Long id);

    @ApiOperation(value = "初始dp_t_app信息")
    @ScanResource(name = "初始dp_t_app信息", path = API + "/init", method = RequestMethod.GET)
    Result<DpTAppResult> init();

    /**
     * 分页获取dp_t_app
     *
     * @param query 查询条件
     * @return 返回结果
     */
    @ApiOperation(value = "分页获取dp_t_app")
    @ScanResource(name = "分页获取dp_t_app",path = API, method = RequestMethod.GET)
    Result<PageResult<DpTAppResult>> page(@Valid @SpringQueryMap DpTAppQuery query);

    /**
     * 通过Excel导入dp_t_app数据
     *
     * @return 返回结果
     */
    @ApiOperation(value = "通过Excel导入dp_t_app数据")
    @ScanResource(name = "通过Excel导入dp_t_app数据", path = API + "/import-excel", method = RequestMethod.POST)
    Result<String> importExcel(MultipartHttpServletRequest request);

    /**
     * 导出dp_t_app数据到Excel
     *
     * @param query 查询条件
     * @return 返回结果
     */
    @ApiOperation(value = "通过excel导入dp_t_app数据")
    @ScanResource(name = "通过excel导入dp_t_app数据", path = API + "/export-excel", method = RequestMethod.GET)
    ModelAndView exportExcel(@Valid @SpringQueryMap DpTAppQuery query);
}
